var map;
var marker ;

$(document).ready(
    function(){
        $(function() {
            //var chicago = new google.maps.LatLng(41.875696,-87.624207);
            eval($('#center').val());
            var myOptions = {
              zoom: 11,
              center: center,
              mapTypeId: google.maps.MapTypeId.HYBRID
            }
          
            map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
            var kml = $("#kmlurl").val();
                        
            //alert(kml);
            var ctaLayer = new google.maps.KmlLayer(kml);
            ctaLayer.setMap(map);
        }
    );}
);

function setIcon(lat, lon)
{
    //alert(lat+","+lon);
    var myLatlng = new google.maps.LatLng(lat,lon);
    if (marker) marker.setMap(null);

    marker = new google.maps.Marker({
        position: myLatlng, 
        map: map,
        title:"Point",
        draggable: false,
        animation: google.maps.Animation.DROP
        //visible: false
    });
    map.setCenter(myLatlng);
    
    
}